﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace judgePrime
{
    public class isPrime
    {
        public bool isPrimeNum(int num)
        {
            if (num <= 1)
            {
                return false;
            }

            if (num > 2 && num % 2 == 0)
            {
                return false;
            }

            for (int i = 3; i <= Math.Sqrt(num); i += 2)
            {
                if (num % i == 0)
                {
                    return false;
                }
            }
            return true;
        }
    }
}
